###########################################################
# $Id: xrsh_tests.sh 3341 2012-07-15 06:32:38Z xrdk $
# brief	    : 
# author    : xrdk
# version   : V1.0, 2004-03-16
#
# CopyRight (C) 2004-2011 xrdk.
# All rights reserved.
###########################################################

xrmk_curdir=.
xrmk_shdir=.

source $xrmk_shdir/xrmake_scripts.sh

#=====================================================================

#=====================================================================
xrsh_test_common=

if test "$xrsh_test_common" != ""; then
echo test common scripts
echo ------------------------------------------------------------------
echo xrsh_getcurpath: `xrsh_getcurpath`
echo xrsh_getexepath gcc: `xrsh_getexepath "gcc" "/usr/local/bin/gcc"`
echo 
echo xrmk_host_get_name: `xrmk_host_get_name`
echo xrmk_host_get_name_ex: `xrmk_host_get_name_ex`
echo xrmk_host_get_arch: `xrmk_host_get_arch`
echo xrmk_host_get_arch_ex: `xrmk_host_get_arch_ex`
echo
echo xrsh_tolower: `xrsh_tolower "TesR"`
echo

xrsh_array=(i1 i2 i3)
xrsh_tmp=`echo ${xrsh_array[*]}`

function xrsh_cb_fn()
{
	echo "-- index $1, item $2, usr $3"
}

echo xrsh_foreach array: ${xrsh_array[*]}
xrsh_foreach "$xrsh_tmp" xrsh_cb_fn
echo xrsh_hasitem i2: `xrsh_hasitem "$xrsh_tmp" "i2"`
echo xrsh_hasitem i4: `xrsh_hasitem "$xrsh_tmp" "i4"`
echo xrsh_itemidx i3: `xrsh_itemidx "$xrsh_tmp" "i3"`

echo
echo xrsh_cmpnum 3 5: `xrsh_cmpnum 3 5`
echo xrsh_cmpnum 3 3: `xrsh_cmpnum 3 3`
echo xrsh_cmpnum 3 2: `xrsh_cmpnum 3 2`
echo xrsh_getnumplace 123: `xrsh_getnumplace 123`
echo xrsh_getnumplace 123 100: `xrsh_getnumplace 123 100`
echo xrsh_getnumplace 123 10: `xrsh_getnumplace 123 10`
echo xrsh_getdotnum 1.2.3: `xrsh_getdotnum "1.2.3"`
echo xrsh_getdotnum 1.2.3 2: `xrsh_getdotnum "1.2.3" 2`
echo xrsh_getdotnum 1.2.3 3: `xrsh_getdotnum "1.2.3" 3`
echo xrsh_getdotnumstr xyz1.2.3: `xrsh_getdotnumstr "xyz1.2.3"`
echo xrsh_getdotnumstr 10.12.43: `xrsh_getdotnumstr "10.12.43"`
echo xrsh_getdot2numstr xyz1.2: `xrsh_getdot2numstr "xyz1.2"`

fi #xrsh_test_common



